3.2.26 \(\int \frac {\sec (c+d x)}{(a+i a \tan (c+d x))^2} \, dx\) [126]

Optimal. Leaf size=65 \[ \frac {i \sec (c+d x)}{3 d (a+i a \tan (c+d x))^2}+\frac {i \sec (c+d x)}{3 d \left (a^2+i a^2 \tan (c+d x)\right )} \]

[Out]

1/3*I*sec(d*x+c)/d/(a+I*a*tan(d*x+c))^2+1/3*I*sec(d*x+c)/d/(a^2+I*a^2*tan(d*x+c))

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 65, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {3583, 3569} \begin {gather*} \frac {i \sec (c+d x)}{3 d \left (a^2+i a^2 \tan (c+d x)\right )}+\frac {i \sec (c+d x)}{3 d (a+i a \tan (c+d x))^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]/(a + I*a*Tan[c + d*x])^2,x]

[Out]

((I/3)*Sec[c + d*x])/(d*(a + I*a*Tan[c + d*x])^2) + ((I/3)*Sec[c + d*x])/(d*(a^2 + I*a^2*Tan[c + d*x]))

Rule 3569

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[b*(d*
Sec[e + f*x])^m*((a + b*Tan[e + f*x])^n/(a*f*m)), x] /; FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 + b^2, 0] &
& EqQ[Simplify[m + n], 0]

Rule 3583

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[a*(d*
Sec[e + f*x])^m*((a + b*Tan[e + f*x])^n/(b*f*(m + 2*n))), x] + Dist[Simplify[m + n]/(a*(m + 2*n)), Int[(d*Sec[
e + f*x])^m*(a + b*Tan[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, m}, x] && EqQ[a^2 + b^2, 0] && LtQ[n
, 0] && NeQ[m + 2*n, 0] && IntegersQ[2*m, 2*n]

Rubi steps

\begin {align*} \int \frac {\sec (c+d x)}{(a+i a \tan (c+d x))^2} \, dx &=\frac {i \sec (c+d x)}{3 d (a+i a \tan (c+d x))^2}+\frac {\int \frac {\sec (c+d x)}{a+i a \tan (c+d x)} \, dx}{3 a}\\ &=\frac {i \sec (c+d x)}{3 d (a+i a \tan (c+d x))^2}+\frac {i \sec (c+d x)}{3 d \left (a^2+i a^2 \tan (c+d x)\right )}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.13, size = 38, normalized size = 0.58 \begin {gather*} \frac {\sec (c+d x) (-2 i+\tan (c+d x))}{3 a^2 d (-i+\tan (c+d x))^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]/(a + I*a*Tan[c + d*x])^2,x]

[Out]

(Sec[c + d*x]*(-2*I + Tan[c + d*x]))/(3*a^2*d*(-I + Tan[c + d*x])^2)

________________________________________________________________________________________

Maple [A]
time = 0.36, size = 57, normalized size = 0.88

method result size
risch \(\frac {i {\mathrm e}^{-i \left (d x +c \right )}}{2 a^{2} d}+\frac {i {\mathrm e}^{-3 i \left (d x +c \right )}}{6 a^{2} d}\) \(38\)
derivativedivides \(\frac {-\frac {4}{3 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {2 i}{\left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {2}{-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}}{a^{2} d}\) \(57\)
default \(\frac {-\frac {4}{3 \left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{3}}+\frac {2 i}{\left (-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {2}{-i+\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}}{a^{2} d}\) \(57\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)/(a+I*a*tan(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

2/d/a^2*(-2/3/(-I+tan(1/2*d*x+1/2*c))^3+I/(-I+tan(1/2*d*x+1/2*c))^2+1/(-I+tan(1/2*d*x+1/2*c)))

________________________________________________________________________________________

Maxima [A]
time = 0.30, size = 45, normalized size = 0.69 \begin {gather*} \frac {i \, \cos \left (3 \, d x + 3 \, c\right ) + 3 i \, \cos \left (d x + c\right ) + \sin \left (3 \, d x + 3 \, c\right ) + 3 \, \sin \left (d x + c\right )}{6 \, a^{2} d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)/(a+I*a*tan(d*x+c))^2,x, algorithm="maxima")

[Out]

1/6*(I*cos(3*d*x + 3*c) + 3*I*cos(d*x + c) + sin(3*d*x + 3*c) + 3*sin(d*x + c))/(a^2*d)

________________________________________________________________________________________

Fricas [A]
time = 0.35, size = 30, normalized size = 0.46 \begin {gather*} \frac {{\left (3 i \, e^{\left (2 i \, d x + 2 i \, c\right )} + i\right )} e^{\left (-3 i \, d x - 3 i \, c\right )}}{6 \, a^{2} d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)/(a+I*a*tan(d*x+c))^2,x, algorithm="fricas")

[Out]

1/6*(3*I*e^(2*I*d*x + 2*I*c) + I)*e^(-3*I*d*x - 3*I*c)/(a^2*d)

________________________________________________________________________________________

Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 112 vs. \(2 (51) = 102\).
time = 0.56, size = 112, normalized size = 1.72 \begin {gather*} \begin {cases} \frac {\tan {\left (c + d x \right )} \sec {\left (c + d x \right )}}{3 a^{2} d \tan ^{2}{\left (c + d x \right )} - 6 i a^{2} d \tan {\left (c + d x \right )} - 3 a^{2} d} - \frac {2 i \sec {\left (c + d x \right )}}{3 a^{2} d \tan ^{2}{\left (c + d x \right )} - 6 i a^{2} d \tan {\left (c + d x \right )} - 3 a^{2} d} & \text {for}\: d \neq 0 \\\frac {x \sec {\left (c \right )}}{\left (i a \tan {\left (c \right )} + a\right )^{2}} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)/(a+I*a*tan(d*x+c))**2,x)

[Out]

Piecewise((tan(c + d*x)*sec(c + d*x)/(3*a**2*d*tan(c + d*x)**2 - 6*I*a**2*d*tan(c + d*x) - 3*a**2*d) - 2*I*sec
(c + d*x)/(3*a**2*d*tan(c + d*x)**2 - 6*I*a**2*d*tan(c + d*x) - 3*a**2*d), Ne(d, 0)), (x*sec(c)/(I*a*tan(c) +
a)**2, True))

________________________________________________________________________________________

Giac [A]
time = 0.63, size = 47, normalized size = 0.72 \begin {gather*} \frac {2 \, {\left (3 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 3 i \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2\right )}}{3 \, a^{2} d {\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - i\right )}^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)/(a+I*a*tan(d*x+c))^2,x, algorithm="giac")

[Out]

2/3*(3*tan(1/2*d*x + 1/2*c)^2 - 3*I*tan(1/2*d*x + 1/2*c) - 2)/(a^2*d*(tan(1/2*d*x + 1/2*c) - I)^3)

________________________________________________________________________________________

Mupad [B]
time = 3.51, size = 79, normalized size = 1.22 \begin {gather*} -\frac {2\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,3{}\mathrm {i}+3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-2{}\mathrm {i}\right )}{3\,a^2\,d\,\left (-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,1{}\mathrm {i}-3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,3{}\mathrm {i}+1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(c + d*x)*(a + a*tan(c + d*x)*1i)^2),x)

[Out]

-(2*(3*tan(c/2 + (d*x)/2) + tan(c/2 + (d*x)/2)^2*3i - 2i))/(3*a^2*d*(tan(c/2 + (d*x)/2)*3i - 3*tan(c/2 + (d*x)
/2)^2 - tan(c/2 + (d*x)/2)^3*1i + 1))

________________________________________________________________________________________